import socket

# 创建对象
client = socket.socket()

# 连接服务器
client.connect(('127.0.0.1', 8899))

print('--------连接建立成功-----')
# 发送数据
# client.send('client send data'.encode('utf-8'))

# 接收数据
while True:
    info = input('请输入回复服务器的信息：')
    client.send(info.encode('utf-8'))

    data = client.recv(1024)
    s = data.decode('utf-8')
    print('接收返回值：',s)
    if info == 'bye' :
        break

client.close()